//
//  SelectionOneCollectionViewCell.m
//  TakeHer
//
//  Created by 胖疙瘩的小疙瘩 on 15/6/11.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "SelectionOneCollectionViewCell.h"

@implementation SelectionOneCollectionViewCell

-(void)dealloc
{
    [_placeLabel release];
    [_dateLabel release];
    [_myImageView release];
    [_nameLabel release];
    
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.myImageView = [[UIImageView alloc]init];
        self.myImageView.backgroundColor = [UIColor clearColor];
        self.myImageView.layer.cornerRadius = 20.0;
        self.myImageView.clipsToBounds = YES;
        [self.contentView addSubview:self.myImageView];
        [_myImageView release];
        
        self.placeLabel = [[UILabel alloc]init];
        self.placeLabel.textAlignment = NSTextAlignmentCenter;
        //self.placeLabel.textColor = [UIColor whiteColor];
        [self.contentView addSubview:self.placeLabel];
        [_placeLabel release];
        
        self.dateLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.dateLabel];
        [_dateLabel release];
        
        self.nameLabel = [[UILabel alloc]init];
        self.nameLabel.textColor = [UIColor whiteColor];
        self.nameLabel.shadowOffset = CGSizeMake(1, 1);
        self.nameLabel.shadowColor = [UIColor blackColor];
        [self.contentView addSubview:self.nameLabel];
        [_nameLabel release];
        
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    CGFloat width = layoutAttributes.frame.size.width;
    CGFloat height = layoutAttributes.frame.size.height / 6;
   
    self.placeLabel.frame = CGRectMake(width / 7, height * 5, width, height);
    self.dateLabel.frame = CGRectMake(0, height * 5, width, height);
    self.myImageView.frame = CGRectMake(0, 0, width, height *5);
    self.nameLabel.frame = CGRectMake(0, height * 4, width, height);
}





@end
